<?php

declare(strict_types=1);
/**
 * Created by PhpStorm.
 * User: yangfan
 * Date: 2019/11/2
 * Time: 10:44 AM
 */

namespace App\Utils;

class UserLocationSessionUtil
{
    public const USER_LOCATION_CITY_ID = 'user.loc_city_id';

    private $session;

    public function __construct()
    {
        $this->session = session();
    }

    /**
     * 获取用户地址信息
     *
     * @return mixed
     */
    public static function getLocationCityId()
    {
        return session()->get(self::USER_LOCATION_CITY_ID);
    }

    /**
     * 设置用户城市ID信息
     *
     * @param $id
     */
    public function setLocationCityId($id)
    {
        $this->session->put(self::USER_LOCATION_CITY_ID, $id);
    }
}
